require "admin/users_controller"
class AccountsController < ApplicationController
  def login
    @user = User.new(params[:user])
    @page_title = "Login"
  end
  
  def authenticate    
    self.logged_in_user = User.authenticate(params[:user][:username], params[:user][:password])
    if is_logged_in?
      redirect_to dashboard_path
    else
      flash[:error] = "I'm sorry; either your username or password was incorrect."
      redirect_to :action => 'login'
    end
  end
  
  def logout
    reset_session
    flash[:notice] = "You have been logged out."      
    redirect_to login_path
  end  

  def forgot_password
  end
  
  def index
    @page_title = "Dashboard"
  end
  
end
